package com.easylive.entity.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Author: yudaxian
 * @DateTime: 2024/12/18 11:06
 * 跟ES中的属性名对应
 **/
@Getter
@AllArgsConstructor
public enum SearchOrderTypeEnum {
    VIDEO_PLAY(0, "playCount", "播放量"),
    VIDEO_TIME(1, "createTime", "播放时间"),
    VIDEO_DANMU(2, "danmuCount", "弹幕数"),
    VIDEO_COLLECT(3, "collectCount", "收藏数")
    ;

    private Integer type;

    private String field;

    private String desc;

    public static SearchOrderTypeEnum getType(Integer type) {
        for (SearchOrderTypeEnum searchOrderTypeEnum : SearchOrderTypeEnum.values()) {
            if (searchOrderTypeEnum.getType().equals(type)) {
                return searchOrderTypeEnum;
            }
        }
        return null;
    }
}
